package com.qing.search

import org.apache.lucene.document.Document
import org.apache.lucene.index.IndexableField
import org.apache.spark.{Partition, SparkContext, TaskContext}

import scala.collection.mutable.ListBuffer

/**
  * Created by wuliao on 2017/8/17.
  */
private[search] class LucenePageRDD(@transient sc: SparkContext,
                                    params: java.util.Map[String, Array[String]],
                                    var page: Int = 1)

  extends AbstractLuceneRDD[Tuple2[Float,String]](sc, params) {
  override def compute(split: Partition, context: TaskContext): Iterator[Tuple2[Float,String]] = {
    new LucenePageRDDIterator(context, split.asInstanceOf[LucenePartition].path, params,page).docs
  }
}

